<template>
    <div class="cardlist zxzbg2">
        <div :class="{  Avtive:isActive }" v-if="isActive">
      
        </div>
        <div class='blanklogobg'>
            <img :src='cccard.issuingBank | fmtBankimsrc'>
        </div>
        {{cccard.issuingBank |
        fmtBankCode}}({{cccard.cardNumber | fmtCardNo
        }})

        <span class="dzx">完成</span>
        <div style="clear:both"></div>
          <!-- <div :class="{ showtext:isshowtext}" v-if="isshowtext">
            <marquee  style="margin:0px auto;width:100%;" >注意:{{list}}执行计划要提高信用卡的扫码支付额度（单笔一千，单日大于该计划的预留金额，单月大于该计划的还款金额）可拨打银行客服电话95595或在光大银行app设置</marquee>
          </div> -->
        <div class="w9mau">
            <p style="font-size:12px;color:white;line-height: 20px;">方案进度：{{cccard.plan.alreadyAmount
                | fmtAmount}}/{{cccard.plan.totalAmount | fmtAmount}}</p>
            <van-progress :percentage="cccard.plan.alreadyAmount/cccard.plan.totalAmount*100 |fmtjdt"
                :show-pivot='false' color="#A1C4CE" />
        </div>

        <button class="zdjh" style="margin:15px 20px;margin-top:20px;" @click="ckxq(cccard)">查看详情</button>
        <button class="zdjh" style="margin:20px 0 15px 0;" @click="zdjh(cccard)">制定计划</button>
        <!-- <button class="zdjh" v-if="tostopa" style="margin:15px 0;margin-top:20px;" @click="isshow">制定计划</button> -->
        <Modal v-model="stopplan" :closable="false" cancel-text='' ok-text='确定'>
            <p style="text-align: left;"> 提示:</p>
            <p style="text-align: center;margin-top:20px;">提示:通道维护，请使用其他通道制定计划。</p>
        </Modal>
        <div style="clear:both"></div>
    </div>

</template>
<script>
  export default {
    props: ['cccard'],
    data(){
      return{
        isActive:false,
        stopplan:false,
        tostopa:false,
        tostop:false,
        isshowtext:false,
        list:'光大银行',
      }
    },
    created(){
      // if(this.$store.state.institutionId == 'T00000003'){
      //     this.tostopa = true
      // }
      // if(this.$store.state.institutionId != 'T00000003'){
      //     this.tostop = true
      // }
      this.show()
    },
    methods:{
     
      
      zdjh(cccard){
        // if(this.$store.state.institutionId=='T00000009'){
        //     this.stopplan=true
       
        this.$store.state.cccard = cccard;
        if(this.$store.state.bankone.indexOf(this.$store.state.cccard.issuingBank)>-1){
            this.$store.state.channelCode = '101002'
        }else if(this.$store.state.banktwo.indexOf(this.$store.state.cccard.issuingBank)>-1){
            this.$store.state.channelCode = '101001'
        }
        axios.get(this.$store.state.host + '/sign/select',{
            params:{
                merchantId: this.$store.state.merchantId,
                cardNo: this.$store.state.cccard.cardNumber,
            }
        }).then(res=>{
            if(res.data.respCode == '0000'){
                var aisleMerId = res.data.data.aisleMerId
                axios.get(this.$store.state.host + '/plans/updateRate',{
                    params:{
                        aisleMerId:res.data.data.aisleMerId,
                        merchantId: this.$store.state.merchantId,
                        cardNo: this.$store.state.cccard.cardNumber,
                        institutionId: this.$store.state.institutionId,
                        aisleCode:'ld15',
                        channelCode:this.$store.state.channelCode,
                        creditCardCode:this.$store.state.cccard.issuingBank,
                    }
                }).then(res=>{
                    if(res.data.respCode == '0000'){

                        this.$router.push({
                            name:'zdjh',
                            params:{
                                aisleMerId:aisleMerId,
                            }
                        })
                    }else{
                        Toast(res.data.respDesc);
                    }
                })
            }else{
                axios.get(this.$store.state.host + '/bind/select',{
                    params:{
                        merchantId: this.$store.state.merchantId,
                        cardNo: this.$store.state.cccard.cardNumber,
                        channelCode:this.$store.state.channelCode
                    }
                }).then(res=>{
                        if(res.data.respCode == '0000'){
                            var aisleMerId = res.data.data.aisleMerId
                            // axios.get(this.$store.state.host + '/product/select',{
                            //     params:{
                            //         merchantId:this.$store.state.merchantId,
                            //         channelCode:this.$store.state.channelCode
                            //     }
                            // }).then(res=>{
                            //     if(res.data.respCode == '0000'){
                            //         this.$router.push({
                            //             name:'ktxyzf',
                            //             params:{
                            //                 aisleMerId:aisleMerId
                            //             }
                            //         })
                            //     }else{
                                    axios.get(this.$store.state.host + '/',{
                                        params:{
                                            merchantId:this.$store.state.merchantId,
                                            aisleCode:'ld15',
                                            merchantCode:aisleMerId,
                                            channelCode:this.$store.state.channelCode,
                                            institutionId:this.$store.state.institutionId,
                                            creditCardCode:this.$store.state.cccard.issuingBank,
                                        }
                                    }).then(res=>{
                                        if(res.data.respCode == '0000'){
                                            this.$router.push({
                                                name:'ktxyzf',
                                                params:{
                                                    aisleMerId:aisleMerId
                                                }
                                            })
                                        }else{
                                            this.$toast(res.data.respDesc)
                                        }
                                    })
                                // }
                            // })
                            
                        }else{
                            // axios.get(this.$store.state.host + 'product/select',{
                            //     params:{
                            //         merchantId:this.$store.state.merchantId,
                            //         channelCode:this.$store.state.channelCode
                            //     }
                            // }).then(res=>{
                                
                            // })
                            this.$router.push({
                                name:'ktxyzf',
                            })
                        }
                    })
            }
        })
        
      }
      
    }
  }
</script>
<style scoped>
 .Avtive{
    width:100%;
    z-index: 10;
    position:absolute;
    height:100%;
    border-radius: 10px;
    line-height: 200px;
    background:url('http://hstatic.1818pay.cn/image/disable/jtmb@2x.png') no-repeat;
    background-position: 100% 100%;
    background-size: 125% 100%;
  }
.showtext{
    width:100%;
    width:100%;
    background:white;
    color:rgb(78, 78, 78);
    height:20px;
    line-height:20px;
  }
</style>
